SRC = src/main.c src/xoutput.c src/payload.c
EXEC_NAME = wmstatustext

CFLAGS += -Wall -Wextra -Wpedantic --std=c99 `pkg-config --cflags x11`
LDFLAGS += `pkg-config --libs x11`
INCLUDE += -Iinclude `pkg-config --cflags-only-I x11`

include config/config.mk

all: options main

options:
	@echo "CFLAGS   = ${CFLAGS}"
	@echo "LDFLAGS  = ${LDFLAGS}"
	@echo "CC       = ${CC}"
	@echo "PREFIX   = ${PREFIX}"
	@echo ""

main: clean
	mkdir -p ./bin
	${CC} ${SRC} ${INCLUDE} ${CFLAGS} ${LDFLAGS} -o ./bin/${EXEC_NAME}

install:
	cp -i bin/${EXEC_NAME} ${PREFIX}/bin

uninstall:
	rm -i ${PREFIX}/bin/${EXEC_NAME}

clean:
	rm -rf ./bin

.PHONY: all clean install uninstall
